<template>
  <div id="security_center">
    <div class="top">
      <van-icon @click="goBack()" name="arrow-left"/>
      <div class="title">
        安全中心<br>
        全面保障您的出行安全<br>
        <div class="y">
          <van-icon name="success"/>
        </div>
        <span>100%司机已通过安全检车</span>
      </div>
      <div class="icon">
        <van-image src="https://img.tukuppt.com/png_preview/00/50/48/v02nePSkuo.jpg!/fw/780" width="100px"
                   height="100px"/>
      </div>
      <div class="b">
        <div class="t">
          <van-icon name="shield-o"/>
          <span>安全工具</span>
        </div>
        <div class="x">
          <div class="x1">
            <div class="l">
              紧急联系人<br><span>去设置 ></span>
            </div>
            <van-icon name="user"/>
          </div>
          <div class="x1">
            <div class="l">
              实名认证<br><span>去认证 ></span>
            </div>
            <van-icon name="user"/>
          </div>
          <div class="x1">
            <div class="l">
              安全考核<br><span>去参加 ></span>
            </div>
            <van-icon name="user"/>
          </div>
        </div>
      </div>
    </div>
    <div class="middle">
      <div class="t">
        <div class="l">
          <van-icon name="shield-o"/>
          <span>安全专栏</span>
        </div>
        <div class="r" @click="getFindAll()">More ></div>
      </div>
      <van-cell v-for="(item,index) in SecurityList" :key="index">
        <div class="icon">
          <van-image :src="item.icon" width="100px" height="50px"/>
        </div>
        <div class="name">{{ item.name }}</div>
        <div class="content">{{ item.content }}</div>
      </van-cell>
    </div>
    <div class="bottom">
      <van-button size="large" style="border: 2px solid red;color:red;background-color: #FEE5E5">
        <van-icon name="shield-o"/>
        911
      </van-button>
      <van-button size="large" style="border: 2px solid #9CCFE2;color:#9CCFE2;">
        <van-icon name="shield-o"/>
        行程分享
      </van-button>
    </div>
    <div class="quan">
      <van-popup v-model="show">
        <div class="bu">
          <van-icon @click="toSecurity()" name="arrow-left"/>
        </div>
        <div class="vc">
          <van-cell v-for="(item,index) in findAll" :key="index">
            <div class="icon">
              <van-image :src="item.icon" width="100px" height="50px"/>
            </div>
            <div class="name">{{ item.name }}</div>
            <div class="content">{{ item.content }}</div>
          </van-cell>
        </div>
      </van-popup>
    </div>
  </div>
</template>

<script>


export default {
  data() {
    return {
      findAll: [],
      SecurityList: [],
      show: false,
    };
  },
  methods: {
    toSecurity() {
      this.show = false;
    },
    goBack() {
      this.$router.go(-1);
    },
    getSecurity() {
      // getSecurity().then((res) => {
      //   this.SecurityList = res.data;
      // });
    },
    getFindAll() {
      this.show = true;
      // getFindAll().then((res) => {
      //   this.findAll = res.data;
      // });
    }
  },
  created() {
    this.getSecurity();
  }
};
</script>

<style>
body {
  background-color: #F3FCFF;

  #security_center {
    width: 100%;
    height: 930px;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(to bottom, #53ABCA 30%, #CEE2E4 70%);

    .top {
      width: 100%;
      height: 360px;

      .van-icon {
        width: 50px;
        height: 50px;
        margin-top: 20px;
        margin-left: 10px;
        font-size: 30px;
        color: #fff;
        float: left;
      }

      .title {
        float: left;
        margin-top: 20px;
        margin-left: -10px;
        font-size: 22px;
        font-weight: bold;
        color: #fff;

        .y {
          width: 20px;
          height: 20px;
          background-color: #3CD38F;
          border-radius: 50%;
          margin-top: 5px;
          float: left;

          .van-icon {
            font-size: 20px;
            color: #49BCA1;
            margin-left: 2px;
            margin-top: 1px;
          }
        }

        span {
          font-size: 14px;
          color: #fff;
          margin-left: 10px;
          font-weight: bold;
          display: inline-block;
        }
      }

      .icon {
        margin-top: 10px;
        float: left;
        margin-left: 30px;
      }

      .b {
        width: 90%;
        height: 160px;
        background-color: #fff;
        border-radius: 20px;
        margin-top: 180px;
        margin-left: 5%;

        .t {
          width: 100%;
          height: 60px;
          display: flex;
          align-items: center;

          .van-icon {
            margin-left: 20px;
            margin-top: 10px;
            font-size: 40px;
            color: #3CD38F;
          }

          span {
            font-size: 18px;
            font-weight: 400;
          }
        }

        .x {
          width: 100%;
          height: 100px;
          display: flex;
          align-items: center;
          justify-content: space-around;

          .x1 {
            width: 160px;
            height: 80px;
            border-radius: 10%;
            background-color: #F3FCFF;

            .l {
              font-size: 14px;
              margin-left: 15px;
              margin-top: 20px;

              span {
                color: #53A8FF;
              }
            }

            .van-icon {
              margin-left: 120px;
              margin-top: -32px;
              color: #4EA9CB;
            }
          }
        }
      }
    }

    .middle {
      width: 90%;
      height: 480px;
      background-color: #fff;
      display: flex;
      flex-direction: column;
      align-items: center;
      border-radius: 20px;

      .t {
        width: 90%;
        height: 50px;
        margin: 10px 0;
        display: flex;
        align-items: center;
        justify-content: space-between;

        .l {
          display: flex;
          align-items: center;
          justify-content: space-between;

          .van-icon {
            font-size: 30px;
            margin-right: 10px;
          }
        }

        .r {
          font-size: 18px;
          color: #4FA5FF;
        }
      }

      .van-cell {
        height: 100%;
        width: 90%;
        border-bottom: 1px solid #FBFBFB;

        .icon {
          float: left;
        }

        .name {
          font-size: 16px;
          font-weight: bold;
          margin-left: 120px;
          margin-top: 2px;
        }

        .content {
          font-size: 12px;
          margin-left: 120px;
          margin-top: 2px;
          color: #979897;
        }
      }
    }

    .bottom {
      width: 100%;
      height: 80px;
      margin-top: 10px;
      background-color: #fff;
      display: flex;
      align-items: center;
      justify-content: center;

      .van-button {
        margin: 0 14px;
        border-radius: 10px;
        font-size: 20px;
        font-weight: bold;
      }
    }

    .quan {
      .van-popup {
        width: 100%;
        height: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        overflow: scroll;

        .bu {
          width: 100%;
          height: 66px;
          background-color: white;
          display: flex;
          align-items: center;
          justify-content: center;
          position: fixed;
          top: 0;
          z-index: 999;

          .van-icon {
            font-size: 26px;
            position: absolute;
            left: 20px;
          }

          .title {
            font-size: 20px;
          }
        }

        .vc {
          width: 100%;
          height: 100%;
          margin-top: 66px;
        }
      }
    }
  }
}
</style>
